const env = require('./env.js')

export default {
  // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
  ssr: false,
  router: {
    // base: '/rc-ui',
    mode: 'hash',
    middleware: ['redirect']
  },
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'resource-management',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: './favicon.ico' }
    ]
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: [
    'ant-design-vue/dist/antd.css'
  ],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    '@/plugins/antd-ui',
    '@/plugins/axios',
    '@/plugins/route',
    {
      src: '@/plugins/dateformat',
      ssr: true
    },
    // '@/static/fingerprint2'
  ],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true,

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
  ],

  // Axios module configuration (https://go.nuxtjs.dev/config-axios)
  axios: {
    proxy: true,
    browserBaseURL: env[process.env.MODE].ENV_API
    //browserBaseURL: 'http://10.0.110.24:8085', // 测试地址
    //browserBaseURL: 'http://10.0.111.117:8085', // 张新建
    //browserBaseURL: 'http://rc-api.danqiuedu.com', // 生产
  },

  proxy: {
    '/rc': 'http://10.0.111.117:8085' // 目标接口域名
  },

  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
  }
}
